/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.C525;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class C525Store extends C525 {

    public List<C525> ccurpks_listoftabc525(int pnFH000, int pnFH200, int FC425, int FC475, String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.ccurpks_listoftabc525, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, FC425),
                        new Param(OracleTypes.INTEGER, FC475),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, C525.class);
        } catch (SQLException ex) {
            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public int stdc_tools_inserttabc525(int pnPC525, int pnFC425, int pnFC475, int pnFN100,
            int pnCN526, String pvCV527, String pvCV528, int pnCN529, int pnCN530, int pnCN531, String pvCV532, String pvCV533, String pvCV534, String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.stdc_tools_inserttabc525, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPC525),
                    new Param(OracleTypes.INTEGER, pnFC425),
                    new Param(OracleTypes.INTEGER, pnFC475),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnCN526),
                    new Param(OracleTypes.CHAR, pvCV527),
                    new Param(OracleTypes.CHAR, pvCV528),
                    new Param(OracleTypes.INTEGER, pnCN529),
                    new Param(OracleTypes.INTEGER, pnCN530),
                    new Param(OracleTypes.INTEGER, pnCN531),
                    new Param(OracleTypes.CHAR, pvCV532),
                    new Param(OracleTypes.CHAR, pvCV533),
                    new Param(OracleTypes.CHAR, pvCV534),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.update(dataStetament, C525.class);
        } catch (SQLException ex) {
            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int stdc_tools_stornotabc525(int pnPC525, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdc_tools_stornotabc525, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPC525),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, C525.class);
        } catch (SQLException ex) {
            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
//     public List<C525> findAllC525ForCombo(int pnFH000, int pnFH200, int pnPC525,String pvKV303, String pvLOGIN) {
//        try {
//            DataStatement dataStatement = new DataStatement(PackageContants.COMBO_C525N, OracleTypes.CURSOR, new Param[]{
//                        new Param(OracleTypes.INTEGER, pnFH000),
//                        new Param(OracleTypes.INTEGER, pnFH200),
//                        new Param(OracleTypes.INTEGER, pnPC525),
//                         new Param(OracleTypes.CHAR, pvKV303),
//                        new Param(OracleTypes.CHAR, pvLOGIN)
//                    });
//            return super.find(dataStatement, C525.class);
//        } catch (SQLException ex) {
//            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        } catch (InstantiationException ex) {
//            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        } catch (IllegalAccessException ex) {
//            Logger.getLogger(C525Store.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        }
//    }
}
